package April._25.homework.work5;

import untils.TestFlag;

import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.Socket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Client {
    public static void main(String[] args) throws IOException {
        //创建套接字
        Socket socket = new Socket("127.0.0.1", 9999);
        //获取输出流socket
        OutputStream outputStream = socket.getOutputStream();
        //装换为字符流
        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream);
        //创建线程池
        boolean flag=true;
        //创建线程池
        ExecutorService threadPool = Executors.newFixedThreadPool(2);
        threadPool.submit(new ClientTask(socket));
       /* while(flag){


//            threadPool.submit(new sendTask(socket));
//            if(TestFlag.testFlag){
//                System.out.println("发送完成、准备接收");
//            }
//            threadPool.submit(new reciveTask(socket));


*//*            String msg = scanner.nextLine();
            outputStreamWriter.write(msg);
            outputStreamWriter.flush();*//*
        }*/

    }
}
